package com.example.springbootagain.mapper;

import com.example.springbootagain.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {
    @Select("select * from user_table")
    public List<User> selectAllUser();
    @Select("SELECT * from user_table where uid=#{uid}")
    public User selectOneUser(String uid);
    @Select("select * from user_table where username=#{username} and password=#{password}")
    public User selectLogin(String username, String password);
    @Insert("INSERT INTO user_table values (#{uid},#{username},#{password})")
    public int insertUser(User user);
    @Update("update user_table set password=#{password} where username=#{username}")
    public int updatePassword(User user);
    @Delete("delete from user_table where uid=#{uid}")
    public int deleteUser(User user);
}
